//
//  ConstHeader.h
//  huashiedu
//
//  Created by oceans on 2018/7/28.
//  Copyright © 2018年 hema. All rights reserved.
//

#ifndef ConstHeader_h
#define ConstHeader_h


#ifdef DEBUG
#define NSLog(format, ...) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
#define NSLog(format, ...)
#endif

#define is_iphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

#define is_iphone_x [[UIScreen mainScreen] bounds].size.width >=375.0f && [[UIScreen mainScreen] bounds].size.height >=812.0f && is_iphone

#define XStatusBarHeight (CGFloat)(is_iphone_x?(44):(20))

#define XNavigationHeight (CGFloat)(is_iphone_x?(88):(64))

#define XTabBarHeight (CGFloat)(is_iphone_x?(49+34):(49))

#define XTopSafeSpace (CGFloat)(is_iphone_x?(44):(0))

#define XBotSafeSpace (CGFloat)(is_iphone_x?(34):(0))

#define COLOR(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]

#define ScreenWidth [[UIScreen mainScreen] bounds].size.width
#define ScreenHeight [[UIScreen mainScreen] bounds].size.height

#endif /* ConstHeader_h */
